package com.hibernate.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.javacommon.base.BaseEntity;

/**
 * 广告受众人群属性报表实体类
 * @author zhanggd
 */
@Entity
@Table(name = "REPORT_CATEGORY_MATERIAL_SEX")
public class ReportCategoryMaterialSex extends BaseEntity implements java.io.Serializable{
	
	private static final long serialVersionUID = -7398592535624258975L;
	
    /**
     * ID			db_column: ID
     */
	private Long id;
    /**
     * 用户ID       db_column: USER_ID
     */
	@NotNull 
	private Long userId;
    
    /**
     * 物料ID       db_column: MATERIAL_ID
     */
	@NotNull
	private Long materialId;
	/**
     * 属性ID       db_column: CATEGORY_ID
     */
	@NotNull
	private Long categoryId;
    
    /**
     * 物料曝光PV       db_column: SHOW_PV 
     */ 	
	@NotNull 
	private Long showPv;
    /**
     * 物料曝光UV       db_column: SHOW_UV 
     */ 	
	@NotNull 
	private Long showUv;
    /**
     * 物料点击PV       db_column: CLICK_PV 
     */ 	
	@NotNull 
	private Long clickPv;
    /**
     * 物料点击UV       db_column: CLICK_UV 
     */ 	
	@NotNull 
	private Long clickUv;
	/**
	 * 日期		       db_column: LOG_DATE
	 */
	@NotNull
	private Date logDate;
	
	public ReportCategoryMaterialSex(){
	}
	
	public void setId(Long value) {
		this.id = value;
	}
	
	@Id
	@GeneratedValue(generator = "paymentableGenerator")       
	@GenericGenerator(name = "paymentableGenerator", strategy = "native") 
	@Column(name = "ID", unique = true, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getId() {
		return this.id;
	}
	
	@Column(name = "USER_ID", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getUserId() {
		return this.userId;
	}
	
	public void setUserId(Long value) {
		this.userId = value;
	}
	
	@Column(name = "MATERIAL_ID", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getMaterialId() {
		return this.materialId;
	}
	
	public void setMaterialId(Long value) {
		this.materialId = value;
	}

	@Column(name = "CATEGORY_ID", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getCategoryId() {
		return categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}
	
	@Column(name = "SHOW_PV", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getShowPv() {
		return this.showPv;
	}
	
	public void setShowPv(Long value) {
		this.showPv = value;
	}
	
	@Column(name = "SHOW_UV", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getShowUv() {
		return this.showUv;
	}
	
	public void setShowUv(Long value) {
		this.showUv = value;
	}
	
	@Column(name = "CLICK_PV", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getClickPv() {
		return this.clickPv;
	}
	
	public void setClickPv(Long value) {
		this.clickPv = value;
	}
	
	@Column(name = "CLICK_UV", unique = false, nullable = false, insertable = true, updatable = true, length = 20)
	public Long getClickUv() {
		return this.clickUv;
	}
	
	public void setClickUv(Long value) {
		this.clickUv = value;
	}
	
	@Column(name = "LOG_DATE", unique = false, nullable = false, insertable = true, updatable = true, length = 10)
	public Date getLogDate() {
		return this.logDate;
	}
	
	public void setLogDate(Date value) {
		this.logDate = value;
	}
	
	private Material material;
	public void setMaterial(Material material){
		this.material = material;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "MATERIAL_ID",nullable = false, insertable = false, updatable = false) 
	})
	public Material getMaterial() {
		return material;
	}
	
	private CategoryInfo categoryInfo;

	public void setCategoryInfo(CategoryInfo categoryInfo) {
		this.categoryInfo = categoryInfo;
	}
	
	@ManyToOne(cascade = {}, fetch = FetchType.LAZY)
	@JoinColumns({
		@JoinColumn(name = "CATEGORY_ID",nullable = false, insertable = false, updatable = false) 
	})
	public CategoryInfo getCategoryInfo() {
		return categoryInfo;
	}
	@Transient
	@Override
	public String getTarget() {
		// TODO Auto-generated method stub
		return null;
	}
	@Transient
	@Override
	public Long getTargetId() {
		// TODO Auto-generated method stub
		return null;
	}
	@Transient
	@Override
	public String getTargetName() {
		// TODO Auto-generated method stub
		return null;
	}
}

